import { AuthenticatedRequest } from './auth';
import { Request } from 'express';
import * as multer from 'multer';

export interface FileRequest extends AuthenticatedRequest {
  file?: multer.File;
}

export interface MultipleFilesRequest extends AuthenticatedRequest {
  files?: multer.File[];
}

// 为multer文件上传配置定义类型
export interface UploadConfig {
  fieldName: string;
  destination: string;
  fileTypes: string[];
  maxSize: number; // 以字节为单位
}

// 扩展Express的Request类型
declare global {
  namespace Express {
    interface Request {
      file?: multer.File;
      files?: multer.File[];
    }
  }
}
